package com.yun.zhong.fu.sharecenter.spring_origiond_code_study;

/**
 * @Author RenPu
 * @Date 2022/10/25 15:03
 * @Version 1.0
 * @Description: 静态工厂
 **/
public class StudentFactory {

    public static Student  getStudent(){
        return new Student();
    }



//    xml配置如下  静态工厂的配置
//<?xml version="1.0" encoding="UTF-8"?>
//<beans xmlns="http://www.springframework.org/schema/beans"
//    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
//    xsi:schemaLocation="
//    http://www.springframework.org/schema/beans
//    http://www.springframework.org/schema/beans/spring-beans.xsd">
//
//  <bean id="student" class="com.ruyuan.container.factorymethod.StudentFactory"
//    factory-method="getStudentObject"/>
//
//</beans>




// 非静态工厂的配置内容如下
//    <?xml version="1.0" encoding="UTF-8"?>
//<beans xmlns="http://www.springframework.org/schema/beans"
//    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
//    xsi:schemaLocation="
//    http://www.springframework.org/schema/beans
//    http://www.springframework.org/schema/beans/spring-beans.xsd">
//
//  <bean id="studentFactory" class="com.ruyuan.container.factorymethod.StudentFactory"/>
//  <bean id="student" factory-bean="studentFactory" factory-method="getStudentObject"/>
//
//</beans>




}
